<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>register</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<style type="text/css">
#firstDiv {
	border: 1px solid #577AB2;
	background: url('img/header.jpg');
	position: absolute;
	width: 700px;
	height: 200px;
	margin-left: 300px;
}

.p1 {
	margin-left: 100px;
	text-align: center;
	font-family: "宋体";
	font-size: 25px;
	color: #577AB2;
}

#secdiv {
	background-image:url('images/register.jpg');
	position: absolute;
	margin-top: 200px;
	margin-left: 300px;
	width: 700px;
}
</style>
<script type="text/javascript"
	src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript">
		function checkReg(){
			var name=document.getElementById("regname");
			var email=document.getElementById("regemail");
			var passwd=document.getElementById("passwd");
			var passwd1=document.getElementById("passwd1");
			var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/; 
			if(name.value==""){
				alert("姓名不能为空");
				return false;
			}else if(email.value==""){
				alert("邮箱不能为空");
				return false;
			}else if(!pattern.test(email.value)){
				alert("邮箱格式不正确，请重新填写");
				email.value="";
				return false;
			}else if(passwd.value.length!=6){
				alert("密码长度不小于6位");
				return false;
			}else if(passwd1.value.length!=6){
				alert("确认密码长度应与密码长度一致");
				return false;
			}else if(passwd.value==""){
				alert("密码不能为空");
				return false;
			}else if(passwd1.value==""){
				alert("确认密码不能为空");
				return false;
			}else if(passwd.value!=passwd1.value){
				alert("两次密码输入不一致，请重新输入");
				passwd.value="";
				passwd1.value="";
				return false;
			}else{
				return true;
			}
		}
	
	</script>
</head>
<body>
	<div id="firstDiv">
		<p class="p1">陕西省人才发展网</p>
	</div>
	<div id="secdiv">
	<a href="<%=basePath%>index.html" style="margin-left:20px; text-decoration: none;">去看看，等会儿在注册</a>
		<center>
			<form action="<%=basePath%>servlet/RegisterServlet" method="post" onsubmit="return checkReg()">
				<table style="border-collapse:separate; border-spacing:10px;">
					<tr>
						<td>姓名:</td>
						<td><input type="text" name="name" id="regname"></td>
						<td><p style="color: red;">*</p></td>
					</tr>
					<tr>
						<td>邮箱:</td>
						<td><input type="text" name="email" id="regemail"></td>
						<td><p style="color: red;">*</p></td>
					</tr>
					<tr>
						<td>密码:</td>
						<td><input type="password" name="passwd" id="passwd">
						</td>
						<td><p style="color: red;">*</p></td>
					</tr>
					<tr>
						<td>确认密码:</td>
						<td><input type="password" name="passwd1" id="passwd1"></td>
						<td><p style="color: red;">*</p></td>
					</tr>
					<tr>
						<td>电话:</td>
						<td><input type="text" name="tel"></td>
					</tr>
					<tr>
						<td>住址:</td>
						<td><input type="text" name="address"></td>
					</tr>
					<tr>
						<td>出生日期:</td>
						<td><input class="Wdate" type="text" name="birthday"
							onClick="WdatePicker()"></td>
					</tr>
					<tr>
						<td>性别:</td>
						<td><select name="sex" style="width: 160px;">
								<option>男</option>
								<option>女</option>
						</select></td>
					</tr>
				</table>

				<input type="submit" value="注册" style="margin-top: 20px;" />
				&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="重置" />
			</form>
		</center>
		<font style="margin-left: 100px;font-family: '宋体' ;font-size: 25px;font-weight: bold;">注册说明:</font>
		注册信息中标注红色星号(<font color="red">*</font>)的选项为必填项
	</div>
	
</body>
</html>
